

package com.maoshi.shop.multishop.controller;

import com.maoshi.shop.bean.model.ShopWallet;
import com.maoshi.shop.security.multishop.util.SecurityUtils;
import com.maoshi.shop.service.ShopWalletService;
import com.maoshi.shop.common.annotation.SysLog;

import javax.validation.Valid;

import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import lombok.AllArgsConstructor;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.maoshi.shop.common.util.PageParam;
import com.baomidou.mybatisplus.core.metadata.IPage;


/**
 * 商家钱包信息
 *
 * @author Dwl
 * @date 2019-09-19 14:02:57
 */
@RestController
@AllArgsConstructor
@RequestMapping("/shop/shopWallet" )
public class ShopWalletController {

    private final ShopWalletService shopWalletService;

    /**
     * 通过id查询商家钱包信息
     * @return 单个数据
     */
    @GetMapping("/info" )
    public ResponseEntity<ShopWallet> info() {
        ShopWallet shopWallet = shopWalletService.getShopWalletByShopId(SecurityUtils.getShopUser().getShopId());
        return ResponseEntity.ok(shopWallet);
    }

}
